from sklearn.datasets import load_iris 
from sklearn.model_selection import train_test_split


def dataGet():
  iris = load_iris()
  # print("鸢尾花数据集:\n",iris)
  # print("鸢尾花数据集描述:\n", iris.DESCR) # type: ignore
  # print("鸢尾花特征值名字:\n", iris.feature_names)# type: ignore
  # print("鸢尾花特征值名字:\n", iris.target_names)# type: ignore
  # print("鸢尾花特征值:\n", iris.data,iris.data.shape)# type: ignore
  # 数据集划分
  # 训练集特征值，测试集特征值，训练集目标值，测试集目标值
  # x_train, x_test, y_train, y_test
  x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size = 0.27, random_state = 22)# type: ignore
  print( '训练集特征值',x_train)
  print( '训测试集特征值', x_test)
  print( '训练集目标值',len(y_train))
  print( '测试集目标值', len(y_test))
  
  return None


if __name__ == '__main__':
  dataGet()